package fox.framework.rpc.endpoint.netty.heartbeat;

import fox.framework.rpc.client.heartbeat.Ping;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author cuichao
 * @Description: RpcHeartBeatEncode
 * @Date: create in 2020/4/22 21:53
 */
public class RpcHeartBeatEncode extends MessageToByteEncoder<Ping> {

    @Override
    protected void encode(ChannelHandlerContext ctx, Ping ping, ByteBuf out) throws Exception {

        byte[] bytes = ping.get().getBytes();
        out.writeBytes(bytes);
    }




}
